#include "specialKeys.h"
#include "changeSize.h"
#include "renderScene.h"
#include "setupRC.h"

#include "GLTools.h"

#ifdef __APPLE__
#include <glut/glut.h>
#else
#define FREEGLUT_STATIC
#include <GL/glut.h>
#endif

#include <GL/glew.h>

int main(int argc, char* argv[]) {
	gltSetWorkingDirectory(argv[0]);

	glutInit(&argc, argv);
	glutInitDisplayMode(GLUT_DOUBLE | GLUT_RGB | GLUT_DEPTH);
	glutInitWindowSize(800,600);

	glutCreateWindow("F-16 in space");

	glutSpecialFunc(specialKeys);
	glutReshapeFunc(changeSize);
	glutDisplayFunc(renderScene);

	GLenum err = glewInit();
	if (GLEW_OK != err) {
		fprintf(stderr, "GLEW Error: %s\n", glewGetErrorString(err));
		return 1;
	}

	setupRC();
	glutMainLoop();
	return 0;
}
